package pratise;

import java.util.HashSet;

public class demo1 {
    public int findRepeatNumber(int[] nums) {
        HashSet<Integer> hashSet = new HashSet<Integer>();
        int repeatNum = 0;
        for (int num : nums) {
            if (!hashSet.add(num)){
                repeatNum=num;
                break;
            }
        }
        return repeatNum;
    }
}
